﻿using System;

using Microsoft.WowAddonStudio.Lua.AST;
using Microsoft.WowAddonStudio.Lua.Model;
using Microsoft.WowAddonStudio.Lua.Support;

namespace Microsoft.WowAddonStudio.Lua.Adapters
{
    /// <summary>
    /// Adds documentation for the <see cref="Assignment"/> nodes in the AST.
    /// </summary>
    public class AssignmentDocumentationAdapter : DocumentationAdapter<Assignment>
    {
        public override void AddDocumentation(DocumentationScope documentationScope, Assignment node)
        {
            base.AddDocumentation(documentationScope, node);

            // Create the declarations
            var declarations = DeclarationFactory.CreateDeclarations(node, node.IsLocal);

            // Add the declarations to the documentation scope
            documentationScope.AddRange(declarations);
        }
    }
}
